package org.tgcloud.group.core.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;

/**
 * @Author SGY
 * @Date 2020/2/17 11:36
 * @Description // scheduler默认线程数
 **/
@Configuration
public class TaskSchedulerConfig {

    @Bean
    public TaskScheduler taskScheduler() {
        ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
        taskScheduler.setPoolSize(100); // 我这里设置的线程数是2,可以根据需求调整
        return taskScheduler;
    }
}
